// 字符串字面量类型用来约束取值只能是某几个字符串中的一个。
type EventName = 'click' | 'hover' | 'scroll'

function handleEvent(ele: Element, eleName: EventName) {
    // ToDo...
}

handleEvent(document.getElementById('hellow'), 'scroll')


class Ss {
    uname: string = "0"
    age: number = 0

    constructor(uname: string, age: number) {
        this.uname = uname
        this.age = age
    }
}

class ShortSS {
    uname: string

    constructor(uname: string) {
        this.uname = uname
    }

}

const ss: Ss = new ShortSS("asdsads")
const ses: ShortSS = new Ss("asdsads", 15)
